import com.auth0.jwt.interfaces.Claim;
import com.bupt.websocket.utils.JwtToken;

import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * Created by ikariyui on 2018/3/15.
 */
public class JwtTokenDemo {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String token = JwtToken.createToken("11");

        System.out.println("Token: "+ token);

        Map<String, Claim> stringClaimMap = JwtToken.verifyToken(token);
        Claim uid = stringClaimMap.get("uid");

        System.out.println(uid.asString());
    }
}
